package com.alvis.media.viewmodel.admin.analysis;

import java.util.List;
import java.util.Map;

/**
 * AI数据分析结果视图模型
 */
public class AIAnalysisResultVM {
    
    /**
     * 电影统计信息
     */
    private MovieStats movieStats;
    
    /**
     * 评分分布
     */
    private RatingDistribution ratingDistribution;
    
    /**
     * 年度趋势
     */
    private YearTrend yearTrend;
    
    /**
     * 相关性矩阵
     */
    private CorrelationMatrix correlationMatrix;
    
    /**
     * ROC曲线数据
     */
    private ROCCurves rocCurves;
    
    /**
     * 模型结果
     */
    private ModelResults modelResults;
    
    /**
     * 混淆矩阵
     */
    private ConfusionMatrix confusionMatrix;
    
    /**
     * 图片列表
     */
    private List<ImageInfo> images;

    // Getters and Setters
    public MovieStats getMovieStats() {
        return movieStats;
    }

    public void setMovieStats(MovieStats movieStats) {
        this.movieStats = movieStats;
    }

    public RatingDistribution getRatingDistribution() {
        return ratingDistribution;
    }

    public void setRatingDistribution(RatingDistribution ratingDistribution) {
        this.ratingDistribution = ratingDistribution;
    }

    public YearTrend getYearTrend() {
        return yearTrend;
    }

    public void setYearTrend(YearTrend yearTrend) {
        this.yearTrend = yearTrend;
    }

    public CorrelationMatrix getCorrelationMatrix() {
        return correlationMatrix;
    }

    public void setCorrelationMatrix(CorrelationMatrix correlationMatrix) {
        this.correlationMatrix = correlationMatrix;
    }

    public ROCCurves getRocCurves() {
        return rocCurves;
    }

    public void setRocCurves(ROCCurves rocCurves) {
        this.rocCurves = rocCurves;
    }

    public ModelResults getModelResults() {
        return modelResults;
    }

    public void setModelResults(ModelResults modelResults) {
        this.modelResults = modelResults;
    }

    public ConfusionMatrix getConfusionMatrix() {
        return confusionMatrix;
    }

    public void setConfusionMatrix(ConfusionMatrix confusionMatrix) {
        this.confusionMatrix = confusionMatrix;
    }
    
    public List<ImageInfo> getImages() {
        return images;
    }
    
    public void setImages(List<ImageInfo> images) {
        this.images = images;
    }

    /**
     * 电影统计信息
     */
    public static class MovieStats {
        private Integer totalCount;
        private Double avgRating;
        private Integer highRatingCount;

        public Integer getTotalCount() {
            return totalCount;
        }

        public void setTotalCount(Integer totalCount) {
            this.totalCount = totalCount;
        }

        public Double getAvgRating() {
            return avgRating;
        }

        public void setAvgRating(Double avgRating) {
            this.avgRating = avgRating;
        }

        public Integer getHighRatingCount() {
            return highRatingCount;
        }

        public void setHighRatingCount(Integer highRatingCount) {
            this.highRatingCount = highRatingCount;
        }
    }

    /**
     * 评分分布
     */
    public static class RatingDistribution {
        private List<String> bins;
        private List<Integer> counts;

        public List<String> getBins() {
            return bins;
        }

        public void setBins(List<String> bins) {
            this.bins = bins;
        }

        public List<Integer> getCounts() {
            return counts;
        }

        public void setCounts(List<Integer> counts) {
            this.counts = counts;
        }
    }

    /**
     * 年度趋势
     */
    public static class YearTrend {
        private List<String> years;
        private List<Double> avgRatings;

        public List<String> getYears() {
            return years;
        }

        public void setYears(List<String> years) {
            this.years = years;
        }

        public List<Double> getAvgRatings() {
            return avgRatings;
        }

        public void setAvgRatings(List<Double> avgRatings) {
            this.avgRatings = avgRatings;
        }
    }

    /**
     * 相关性矩阵
     */
    public static class CorrelationMatrix {
        private List<String> features;
        private List<List<Double>> values;

        public List<String> getFeatures() {
            return features;
        }

        public void setFeatures(List<String> features) {
            this.features = features;
        }

        public List<List<Double>> getValues() {
            return values;
        }

        public void setValues(List<List<Double>> values) {
            this.values = values;
        }
    }

    /**
     * ROC曲线数据
     */
    public static class ROCCurves {
        private List<ROCModel> models;

        public List<ROCModel> getModels() {
            return models;
        }

        public void setModels(List<ROCModel> models) {
            this.models = models;
        }
    }

    /**
     * ROC模型数据
     */
    public static class ROCModel {
        private String name;
        private Double auc;
        private List<Double> fpr;
        private List<Double> tpr;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Double getAuc() {
            return auc;
        }

        public void setAuc(Double auc) {
            this.auc = auc;
        }

        public List<Double> getFpr() {
            return fpr;
        }

        public void setFpr(List<Double> fpr) {
            this.fpr = fpr;
        }

        public List<Double> getTpr() {
            return tpr;
        }

        public void setTpr(List<Double> tpr) {
            this.tpr = tpr;
        }
    }

    /**
     * 模型结果
     */
    public static class ModelResults {
        private String bestModel;
        private List<ModelResult> results;

        public String getBestModel() {
            return bestModel;
        }

        public void setBestModel(String bestModel) {
            this.bestModel = bestModel;
        }

        public List<ModelResult> getResults() {
            return results;
        }

        public void setResults(List<ModelResult> results) {
            this.results = results;
        }
    }

    /**
     * 单个模型结果
     */
    public static class ModelResult {
        private String model;
        private Double accuracy;
        private Double f1;
        private Double rocAuc;
        private Integer tn;
        private Integer fp;
        private Integer fn;
        private Integer tp;

        public String getModel() {
            return model;
        }

        public void setModel(String model) {
            this.model = model;
        }

        public Double getAccuracy() {
            return accuracy;
        }

        public void setAccuracy(Double accuracy) {
            this.accuracy = accuracy;
        }

        public Double getF1() {
            return f1;
        }

        public void setF1(Double f1) {
            this.f1 = f1;
        }

        public Double getRocAuc() {
            return rocAuc;
        }

        public void setRocAuc(Double rocAuc) {
            this.rocAuc = rocAuc;
        }

        public Integer getTn() {
            return tn;
        }

        public void setTn(Integer tn) {
            this.tn = tn;
        }

        public Integer getFp() {
            return fp;
        }

        public void setFp(Integer fp) {
            this.fp = fp;
        }

        public Integer getFn() {
            return fn;
        }

        public void setFn(Integer fn) {
            this.fn = fn;
        }

        public Integer getTp() {
            return tp;
        }

        public void setTp(Integer tp) {
            this.tp = tp;
        }
    }

    /**
     * 混淆矩阵
     */
    public static class ConfusionMatrix {
        private List<List<Integer>> matrix;

        public List<List<Integer>> getMatrix() {
            return matrix;
        }

        public void setMatrix(List<List<Integer>> matrix) {
            this.matrix = matrix;
        }
    }
    
    /**
     * 图片信息
     */
    public static class ImageInfo {
        private String title;
        private String filename;
        
        public String getTitle() {
            return title;
        }
        
        public void setTitle(String title) {
            this.title = title;
        }
        
        public String getFilename() {
            return filename;
        }
        
        public void setFilename(String filename) {
            this.filename = filename;
        }
    }
}
